/*** Eclipse Class Decompiler plugin, copyright (c) 2012 Chao Chen (cnfree2000@hotmail.com) ***/
package com.qihoo.gamecenter.sdk.pay.j;

import android.content.Context;
import android.text.TextUtils;
import com.qihoo.gamecenter.sdk.common.h.d;
import com.qihoo.gamecenter.sdk.common.h.d.a;
import com.qihoo.gamecenter.sdk.common.i.s;
import com.qihoo.gamecenter.sdk.pay.k.c;
import java.util.Map;
import java.util.TreeMap;
import org.json.JSONObject;

public class p extends d {
    public p(Context paramContext, d.a parama) {
        super(paramContext, parama, false);
    }

    protected String a(Context paramContext, String[] paramArrayOfString) {
        String str1 = a(0, paramArrayOfString);
        if (TextUtils.isEmpty(str1)) {
            c.b("GetQihooBiBalanceTask", new Object[] { "GetBalanceTask: Qid is null!" });
            return null;
        }
        String str2 = a(1, paramArrayOfString);
        if (TextUtils.isEmpty(str2)) {
            c.b("GetQihooBiBalanceTask", new Object[] { "GetBalanceTask: Access Token is null!" });
            return null;
        }
        TreeMap localTreeMap = new TreeMap();
        localTreeMap.put("app_key", s.r(paramContext));
        localTreeMap.put("user_id", str1);
        localTreeMap.put("sign_attr", "1");
        localTreeMap.put("access_token", str2);
        return "https://mgame.360.cn/internal/pay_user_balance_v2.json?" + s.a(localTreeMap, s.s(paramContext));
    }

    protected String a() {
        return null;
    }

    protected Map b(Context paramContext, String[] paramArrayOfString) {
        return null;
    }

    protected a b(JSONObject paramJSONObject) {
        if (paramJSONObject != null) {
            a locala = new a();
            a.a(locala, paramJSONObject.optInt("error_code", -1));
            a.a(locala, paramJSONObject.optString("error"));
            a.a(locala, paramJSONObject.optLong("timestamp", System.currentTimeMillis()));
            a.b(locala, paramJSONObject.optLong("balance", 0L));
            return locala;
        }
        return null;
    }

    public static class a {
        private int a = -1;
        private long b;
        private long c;
        private String d;

        public boolean a() {
            return (0 == this.a);
        }

        public int b() {
            return this.a;
        }

        public long c() {
            return this.b;
        }
    }
}